<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>订单列表</title>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/cts/css/style.css" type="text/css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/jquery.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/common.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/jquery.bgiframe.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/popdiv.js"></script>
	
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/DatePicker.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/searchdata.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/cts/js/My97DatePicker/WdatePicker.js"></script>
  	<script src="${pageContext.request.contextPath}/cts/js/workDetailTip/jquery.hoverIntent.minified.js" type="text/javascript" charset="utf-8"></script>
	<!--[if IE]><script src="${pageContext.request.contextPath}/cts/js/workDetailTip/excanvas.js" type="text/javascript" charset="utf-8"></script><![endif]-->
	<script src="${pageContext.request.contextPath}/cts/js/workDetailTip/jquery.bt.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="${pageContext.request.contextPath}/cts/js/workDetailTip/jquery.easing.1.3.js" type="text/javascript" charset="utf-8"></script>
  	
  	
  	<style>
  	.left{ margin: 0;text-align: center;}
	.left span{margin: 2px 12px 2px 1px;_margin: 2px 5px 2px 1px; padding: 0 6px 0 6px; cursor: pointer;}
	.left .on{color:#ba3027; border-left:1px solid #ba3027; border-right:1px solid #ba3027; margin: 2px 11px 2px 0px;_margin: 2px 4px 2px 0px;}
  	</style>
  
  </head>
  <jsp:include page="../im/importIm.jsp?switchFlag=true"></jsp:include>
  <body style="text-align: left;" >
  	<jsp:include page="${pageContext.request.contextPath}/pages/common/pageForm.jsp"></jsp:include>
  	<div id="mainTop" style="margin-top:0px;border: 0px solid red;">
	    <jsp:include flush="true" page="../top.jsp?place=2"></jsp:include>
	</div>
  	<form action="" id="searchForm">
    <input type="hidden" name="itemType" id="itemType" value="0"/>
    
  	<div style="width: 998px; margin: 0 auto;border: 0px solid red;_margin-top:-10px; padding-top: 5px;">
  		<div style="width: 958px;border: 0px solid red;text-align: right;padding-right: 20px;padding-left: 20px;">
  			<input type="radio" name="item" onclick="changeToPage(1);" />&nbsp;订单管理
  			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  			<input type="radio" name="item" onclick="changeToPage(2);" checked="checked"/>&nbsp;财务管理
  		</div>
  		<div style="width: 978px; height: 80px; border: 0px solid yellow;">
  			<div style="float: left;width: 200px;border: 0px solid red;height: 80px; padding-left: 30px;_ padding-left: 0px;cursor: pointer;" onclick="goHome();">
  				<img src="${pageContext.request.contextPath}/cts/images/index_logo.jpg" style="margin-top:20px;"/>
  			</div>
  			<div style="float: left;width:744px; border: 0px solid red;height: 80px;">
  				<div class="left" style="float: left;width:764px;text-align: left;padding-left: 10px;line-height: 22px;height: 24px;">
  					<span id="span_parent_0" onclick="searchByCountType(0);" style="cursor: pointer;">&nbsp;&nbsp;&nbsp;&nbsp;收入<span id="span_1" class="count_num"></span></span>
  					<span id="span_parent_1" onclick="searchByCountType(1);" style="cursor: pointer;">&nbsp;&nbsp;&nbsp;&nbsp;支出<span id="span_2" class="count_num"></span></span>
  					<span id="span_parent_2" onclick="searchByCountType(2);" style="cursor: pointer;">&nbsp;&nbsp;&nbsp;&nbsp;奖励<span id="span_3" class="count_num"></span></span>
  				</div>
  				
  				<div style="text-align: left;width:744px;clear: both;">
  					<div style="float:left;border:0px solid red;height:49px;width:532px;background: url(${pageContext.request.contextPath}/cts/images/work_search.jpg);">
						<div style="float:left;padding-top:11px;padding-left:45px;border:0px solid red;">
							<input style="border:0px solid red; width:400px; height:25px;vertical-align: middle; line-height: 25px" class="input_tip" type="text" name="keyword" id="keyword"/>
						</div>
						<div style="float:left;border:0px solid red;width:65px;height:38px;margin-left: 10px;cursor: pointer;" onclick="searchDataOr();">
							&nbsp;
						</div>
					</div>
						
  					<div style="float: left;height: 50px;line-height: 50px;padding-left: 10px;">
	  					<!-- <a href="javascript:void(0);">高级搜索</a> -->
  					</div>
  				</div>
  			</div>
  		</div>
  		
  					
  		<div style="width: 962px;border: 0px solid green;clear: both;height: 42px;padding-left: 10px;padding-right: 2px;">
  			<div style="width: 100%;height: 42px;margin:0;background: url('${pageContext.request.contextPath}/cts/images/hr_line.jpg') repeat-x bottom right;">
	  			<div style="float: left;text-align: left;width: 470px;vertical-align: middle;_padding-top:5px;margin:0;border: 0px solid green;padding-top: 10px;">
	  				<div id="sleBG_account" style="float:left;display: inline;width: 73px;">     
						<div id="sleHid_account" style="float:left;display: inline;width: 61px;">   
			  				<select name="dateType" class="select" id="dateType" onchange="searchDataOr();" style="width: 79px;">
			  					<option value="30">最近30天</option>
			  					<option value="15">最近15天</option>
			  					<option value="7">最近7天</option>
			  					<option value="3">最近3天</option>
			  					<option value="2">最近2天</option>
			  					<option value="1">当天</option>
			  					<option value="999">全部</option>
			  				</select>
		  				</div>
	  				</div>
	  				<div style="float:left;display: inline;display:block;width:10px;">&nbsp;</div>
	  				<div id="sleBG_account" style="float:left;display: inline;">     
						<div id="sleHid_account" style="float:left;display: inline;">   
			  				<select name="type" class="select" id="type" onchange="searchDataChange( this.value);" style="width: 79px;">
			  					<option value="999">全部收支</option>
			  					<option value="0">收入</option>
			  					<option value="1">支出</option>
			  					<option value="2">奖励</option>
			  				</select>
		  				</div>
	  				</div>
	  			</div>
	  			<div style="float: right;width: 487px;text-align: right;font-size: 10px;margin:0;">
	  				<table id="search_bnt_tab" width="width: 475px;" align="right" border="0" cellpadding="0" cellspacing="0">
	  					<tr>
	  						<s:if test="#request.e.auth7==1 ||#request.e.auth8==1 || #request.e.auth9==1 || #cts_emplcpyid == #cts_companyid">
		  						<td id="operate_a_1" class="target" title=""><a class="a1" href="javascript:showWorkDivItem();" title="">创建</a></td>
	  						</s:if>
	  						<td id="operate_a_3" class="target" title=""><a class="a3" href="javascript:statisticalWorkDiv();">统计</a></td>
	  					</tr>
	  				</table>
	  			</div>
  			</div>
  		</div>	
		<div id="add_work_div" style="position:absolute;float:right;width: 176px;border:0px solid red;z-index:10000;padding-top: 8px;padding-right: 6px;margin-left:840px;*+margin-left:-155px;_margin-left:-155px;">
			<div id="add_work_div_item" style="text-align: right;border: 1px solid #b6bcc1;background-color: white;position: absolute;display: none;" >
				<div class="div_up">&nbsp;</div>
				<div style="padding:10px 15px 15px 15px;">
					<div style="border-left: 1px solid #7B7E73;border-right: 1px solid #7B7E73;border-top: 1px solid #7B7E73;">
				       		<s:if test="#request.e.auth7==1">
					       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;background-color: #e7edd3">
						       		<a href="javascript:showLostTeam(0)" >
				       			       <div>创建应收款</div>
				       		        </a>
					       		</div>
				       		</s:if>
				       		
				       		<s:if test="#request.e.auth8==1">
					       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;background-color: #e7eada;">
						       		<a href="javascript:showLostTeam(1)" >
				       			       <div>创建应付款</div>
				       		        </a>
					       		</div>
				       		</s:if>
				       		
				       		<s:if test="#request.e.auth9==1">
					       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;background-color:#e7edd3;">
						       		<a href="javascript:showLostTeam(2)" >
				       			       <div>创建奖励</div>
				       		        </a>
					       		</div>
				       		</s:if>
			       </div>
		       </div>
			</div>
			<div style="clear: both;">
			</div>
		</div>
		
		<div id="add_work_div2" style="position:absolute;float: right;width: 176px;border:0px solid red;z-index:10000;padding-top: 0px;padding-right: 6px;margin-left:880px;*+margin-left:-130px;_margin-left:-130px;">
			<div id="statistical_work_div" style="text-align: right;border: 1px solid #b6bcc1;background-color: white;position: absolute;display:none;" >
				<div class="div_up">&nbsp;</div>
				<div style="padding:10px 15px 15px 15px;">
					<div style="border-left: 1px solid #7B7E73;border-right: 1px solid #7B7E73;border-top: 1px solid #7B7E73;">
				       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;background-color: #e7edd3;">
					       		 <a target="statistical1" href="toStatisticalWorks?statisticalType=1" >个人奖励</a>
				       		</div>
				       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;background-color: #e7eada;">
					       		<a target="statistical2" href="toStatisticalWorks?statisticalType=2" >公司利润</a>
				       		</div>
				       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;background-color: #e7edd3;">
					       		<a target="statistical3" href="toStatisticsFinancial?statisticsType=0" >应收未收</a>
				       		</div>
				       		<div id ="item_detail_div" style="height:25px;line-height:25px;border-bottom: 1px solid #7B7E73;text-align: left;color:#383838;padding: 0;margin: 0;width:146px;background-color: #e7eada;">
					       		<a target="statistical4" href="toStatisticsFinancial?statisticsType=1" >应付未付</a>
				       		</div>
			       </div>
		       </div>
			</div>
			<div style="clear: both;">
			</div>
		</div>
		
		<!-- 
			<div id="statistical_work_div" style="display: none;">
		       		<div id ="item_detail_div" style="border-bottom: 1px solid #31bc15;text-align: left;padding: 0;margin: 0;width:146px;">
			       		<a target="statistical1" href="toStatisticalWorks?statisticalType=1" >个人奖励</a>
		       		</div>
		       		<div style="border-bottom: 1px solid #fff;height: 1px;"></div>
		       		<div id ="item_detail_div" style="border-bottom: 1px solid #31bc15;text-align: left;padding: 0;margin: 0;width:146px;">
			       		<a target="statistical2" href="toStatisticalWorks?statisticalType=2" >公司利润</a>
		       		</div>
		       		<div style="border-bottom: 1px solid #fff;height: 1px;"></div>
		       		<div id ="item_detail_div" style="border-bottom: 1px solid #31bc15;text-align: left;padding: 0;margin: 0;width:146px;">
			       		<a target="statistical3" href="toStatisticsFinancial?statisticsType=0" >应收未收</a>
		       		</div>
		       		<div style="border-bottom: 1px solid #fff;height: 1px;"></div>
		       		<div id ="item_detail_div" style="border-bottom: 1px solid #31bc15;text-align: left;padding: 0;margin: 0;width:146px;">
			       		<a target="statistical4" href="toStatisticsFinancial?statisticsType=1" >应付未付</a>
		       		</div>
		       		<div style="border-bottom: 1px solid #fff;height: 1px;"></div>
		       		<div id ="item_detail_div" style="text-align: left;padding: 0;margin: 0;width:146px;">
			       		<a target="statistical5" href="toStatisticalWorks?statisticalType=3" >订单统计</a>
		       		</div>
			</div>
		 -->
  		<input type="hidden" id="urlforward" value="cts/searchVerification.action" />
		<div id="pagination" valign="middle" class="pagination" ></div>
		<!-- 具体内容 -->
	  	<div id="workResult" style="height: auto;text-align: center;">
	  	</div>
		
		
  	</div>
  	<input type="hidden" id="seachType" name="seachType" value="1" />
  	</form>
  	
  		
	<div id="lostTeam2" name="n_lostTeam2" class="popdiv_inner" style="width:514px;">
		<div class="popdiv_inner_outter"></div>
		<div class="popdiv_close"></div>
		<div class="popdiv_handle" title="鼠标左键按住可拖动">创建结算单</div>
	  <div class="popdiv_content" style="height:240px;">top:200</div>
	</div>
	
  	<script>
	  	 var o = document.getElementById('add_work_div_item');
		 o.onmouseover = function(){
		 	$('#add_work_div_item').show();
		 }
		 o.onmouseout = function(){
		    $('#add_work_div_item').hide();
		 }
		 
		 function showWorkDivItem(){
 	    	$('#add_work_div_item').show();
 	    	$('#statistical_work_div').hide();
		 }
	 
		 var oo = document.getElementById('statistical_work_div');
		 oo.onmouseover = function(){
		 	$('#statistical_work_div').show();
		 }
		 oo.onmouseout = function(){
		    $('#statistical_work_div').hide();
		 }
		 
		 function statisticalWorkDiv(){
			$('#add_work_div_item').hide();
	 	    $('#statistical_work_div').show();
		 }

		var itemType = 0;
		var seachType = 1;
		function changeItem( val ){
			itemType = val;
			$('#itemType').val(itemType);
			if( $("#advance_div").is(":visible") ){
				advanceSearch(1);
			}
			
			heartBeat();
			$("#workResult").html('');
		    pageNumberVal = 1;
		    $("#pageNumber").val(1);
			searchResult();
			changeTopSpan( val );
			
		}
		
		$(function(){
			$.ajax({//获取计划，进行，完成，暂停数据
				type : "POST",
				url : "cts/getCountVerificationByType.action",
				success : function(data) {
					var arr= data.split(",");
					$("#span_1").html(arr[0]);
					$("#span_2").html(arr[1]);
					$("#span_3").html(arr[2]);
				}
			});
		})
			
	  	$(function(){
	  		var keyword="<s:property value="keyword"/>";
	  		if(keyword!=""){
	  			$('#keyword').val(keyword);
	  		}else{
				$('#keyword').pleaseInput('<s:text name="cts.account.searchDefault"/>',{'font-size':'14px','color':'#C5C3C4'});
			}
			if( $.browser.msie &&  $.browser.version==6 ){
			}else{
				$('body').css("overflow-y", "scroll");
			}
		});
	  	
	  	var pageNumberVal = 1;
	         
	  	$(function(){
			searchResult();
		})
		
		
		
		
		function searchResult(){
			$("#loading").remove();
			$("#workResult").html('');
			$("#workResult").append("<img id='loading' src='${pageContext.request.contextPath}/cts/images/loading.gif'/>");
			$("#seachType").val(seachType);
			
			var path = "${pageContext.request.contextPath}/cts/searchVerification.action?isContentFlag=true";
			$("#pageNumber").val(pageNumberVal);
			var params = $("#searchForm").serialize();
			$.ajax({
				type: "POST",
				url:path,
				async:false,
				cache:false,
				data:params,
				success:function(html){
					$("#workResult").append(html);
					$("#loading").remove();
				}
			});
		}
		
		//Or模糊查询
		function searchDataOr(){
			heartBeat();
			$("#workResult").html('');
		    pageNumberVal = 1;
			searchResult();
		}
		//select change查询
		function searchDataChange( val ){
			heartBeat();
			$("#workResult").html('');
		    pageNumberVal = 1;
		    $("#pageNumber").val(1);
			searchResult();
			changeTopSpan( val );
		}
		
			
		function heartBeat(){ 
			document.getElementById('workResult').scrollTop=0;
		 	$('#workResult').css('top',0);
		 	document.documentElement.scrollTop = 0;
		 	document.body.scrollTop = 0;
		 }	
		 
		
		 
		
		 function goHome(){
		 	window.location.href='${pageContext.request.contextPath}/cts/index';
		 }
		 
		 function searchByCountType( countType ){
		 	$('#type').val(countType);
		 	searchDataChange(countType);
		 }
		 
		 function changeTopSpan( countType ){
		 	for( var i=0;i<=2;i++ ){
		 		if( i == countType ){
		 			$('#span_parent_'+countType).addClass('on');
		 		}else{
		 			//$('#span_text_'+i).removeClass();
		 			$('#span_parent_'+i).removeClass();
		 		}
		 	}
		 }
		function changeToPage( val ){	
		 	if( val == 1 ){
		 		window.location.href = "${pageContext.request.contextPath}/cts/searchWork";
		 	}else if( val == 2 ){
		 		window.location.href = "${pageContext.request.contextPath}/cts/searchVerification";
		 	}
		 } 
		 
	   function showLostTeam(type){
	     $("#add_work_div").hide();
	     openOnePopDiv( 'lostTeam2' , 'teamlist?financialtype='+type ,  200);
	   }
  	</script>
  </body>
</html>
